LeRobot EnvHub
LeRobot EnvHub is a centralized, community-driven repository for robotics simulation environments, hosted on the Hugging Face Hub. It enables seamless collaboration and reproducibility by standardizing environment distribution, versioning, and loading for the Hugging Face LeRobot ecosystem.
Key features:
- One-line loading: Instantly load and run any published environment using a single line of code, e.g.
make_env("lerobot/cartpole-env"). - Version control: Environments are versioned on Hugging Face Hub for consistent reproducibility and easy upgrades.
- Community-driven: Anyone can contribute new environments to the hub, promoting rapid research iteration.
- LW-BenchHub integration: Use any EnvHub environment as the foundation for LW-BenchHub tasks and RL pipelines.
Usage in lw_benchhub
Installation Instructions
Assuming you have already completed the base environment installation via the Installation and Quick Start guides, you only need to install two additional packages to use EnvHub:
uv pip install lerobot==0.4.1
uv pip install numpy==1.26.0
- In some cases, robot USD assets may not be fully downloaded. To ensure all assets are available, you can manually run
git lfs pullagain.
No further configuration is necessary. Once these packages are installed, you are ready to use LeRobot EnvHub environments within your lw_benchhub workflow.
Running an EnvHub Environment with LW-BenchHub
After installation, you can launch any environment shared via EnvHub with the following workflow.
Minimal Example: Random Agent Script
Create a file named envhub_random_action.py (or any Python script) with the following code:
import os
import torch
from lerobot.envs.factory import make_env
# Set the path for your environment configuration file
os.environ['LW_ENVHUB_CONFIG_PATH'] = "configs/envhub/example.yml"
# Instantiate environment from Hugging Face Hub
envs_dict = make_env("LightwheelAI/lw_benchhub_env", n_envs=1, trust_remote_code=True)
# Access the environment instance
suite_name = next(iter(envs_dict))
sync_vector_env = envs_dict[suite_name][0]
# Retrieve the underlying IsaacLab gym environment
env = sync_vector_env.envs[0].unwrapped
# Use the environment like a standard gym.Env
obs, info = env.reset()
while True:
action = torch.tensor(env.action_space.sample())
obs, reward, terminated, truncated, info = env.step(action)
if terminated or truncated:
obs, info = env.reset()
env.close()
Notes:
- You can refer to the contents of
example.ymlat LW-BenchHub's official repository. - The environment configuration is controlled by
LW_ENVHUB_CONFIG_PATH(must point to your.ymlconfig file for the environment). - This script opens the IsaacLab simulator; the robot executes random actions in the loaded environment.
Best Practices
- Use isolated Conda environments to prevent dependency conflicts.
- Always
git lfs pullinlw_benchhubfor updated robot assets. - See LW-BenchHub Quick Start or the dataset docs for downstream policy and data integrations.
For more details and the latest supported environments, visit the LeRobot page on Hugging Face or the official LightwheelAI organization.